//
//  LCAudioTbCell.m
//  TheLCNews
//
//  Created by apple on 15/11/26.
//  Copyright © 2015年 LC. All rights reserved.
//

#import "LCAudioTbCell.h"

@implementation LCAudioTbCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.picImageView = [[UIImageView alloc] init];
        [self.contentView addSubview:self.picImageView];
//        self.picImageView.backgroundColor = [UIColor purpleColor];
        
        self.titleNameLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.titleNameLabel];
//        self.titleNameLabel.backgroundColor = [UIColor blackColor];
        
        self.infoLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.infoLabel];
//        self.infoLabel.backgroundColor = [UIColor grayColor];
        

        
        
    }
    
    return self;
}


- (void)layoutSubviews
{
    [super layoutSubviews];
    
    self.picImageView.frame = CGRectMake(5, 5, CWIDTH / 5, CWIDTH / 5);
    
    self.titleNameLabel.frame = CGRectMake(15 + self.picImageView.frame.size.width, 5, CWIDTH / 3 * 2, CWIDTH / 12);
    
    self.infoLabel.frame = CGRectMake( 15 + self.picImageView.frame.size.width, self.titleNameLabel.frame.size.height + 10, CWIDTH / 3 * 2, CWIDTH / 12);
    

}


- (void)setModel:(LCAudelModel *)model
{
    if (_model != model) {
        
        _model = model ;
    }
    
    [self.picImageView sd_setImageWithURL:[NSURL URLWithString:model.pic] placeholderImage:[UIImage imageNamed:@"ppp"]];
    
    self.titleNameLabel.text = model.name;
    self.titleNameLabel.font = [UIFont systemFontOfSize:15];
    
    self.infoLabel.text = model.info;
    self.infoLabel.font = [UIFont systemFontOfSize:14];
    self.infoLabel.textColor = [UIColor grayColor];
    
//    self.likeLabel.text = [NSString stringWithFormat:@"%@", model.like_count];
}









/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
